<?php /*a:3:{s:103:"/Users/huangjiapeng/未命名文件夹/git/A3Mall-GITEE/server/app/admin/view/wechat/reply/defaults.php";i:1637394809;s:93:"/Users/huangjiapeng/未命名文件夹/git/A3Mall-GITEE/server/app/admin/view/main/layout.php";i:1639309502;s:107:"/Users/huangjiapeng/未命名文件夹/git/A3Mall-GITEE/server/app/admin/view/wechat/common/wechat_menu.php";i:1629663074;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>A3Mall | Dashboard</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/static/system/js/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/system/font/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/system/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/static/system/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="/static/system/js/layui/css/layui.css">
    <link rel="stylesheet" href="/static/system/css/base.css">
    <script src="/static/system/js/jquery/jquery.min.js"></script>
    <script src="/static/system/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/static/system/js/layui/layui.js"></script>
    <script src="/static/system/js/fastclick/fastclick.js"></script>
    <script src="/static/system/js/adminlte/adminlte.min.js"></script>
    <script src="/static/system/js/jquery-slimscroll/jquery.slimscroll.min.js"></script>
    <script src="/static/system/js/common/common.js"></script>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType:"application/x-www-form-urlencoded;charset=utf-8",
            complete:function(XMLHttpRequest,textStatus){
                var res = XMLHttpRequest.responseText;
                try{
                    var jsonData = JSON.parse(res);
                    if(jsonData.code == -1000){
                        window.location.href = '<?php echo createUrl("login/index"); ?>';
                    }else if(jsonData.code == -999){
                        layer.msg(jsonData.msg,{ icon: 2, time: 5000 },function () {
                            window.history.go(-1);
                        });
                    }
                }catch(e){}
            }
        });
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

    <header class="main-header">

        <!-- Logo -->
        <a href="<?php echo createUrl('platform.index/index'); ?>" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>A3</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>A3Mall</b></span>
        </a>

        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <div class="navbar-custom-menu navbar-left navbar-list-top">
                <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                    <span class="sr-only">Toggle navigation</span>
                </a>
                <ul class="nav navbar-nav">
                    <?php if(isset($sidebar['top'])): if(is_array($sidebar['top']) || $sidebar['top'] instanceof \think\Collection || $sidebar['top'] instanceof \think\Paginator): $i = 0; $__LIST__ = $sidebar['top'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?>
                        <li class="<?php if($menu['active']): ?>active<?php endif; ?>"><a href="<?php echo htmlentities($menu['url']); ?>"><?php echo htmlentities($menu['name']); ?></a></li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    <?php endif; ?>
                </ul>
            </div>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li><a href="<?php echo url('home/index/index'); ?>" target="_blank"><i class="fa fa-home"></i>&nbsp;网站前台</a></li>
                    <li><a href="<?php echo url('login/logout'); ?>"><i class="fa fa-sign-out"></i>&nbsp;退出</a></li>
                </ul>
            </div>

        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="/static/system/images/avatar.jpeg" class="img-circle" alt="User Image">
                </div>
                <div class="pull-left info">
                    <p><?php echo session("users.username"); ?></p>
                    <p style="font-size: 12px;"><?php echo session("users.title"); ?></p>
                </div>
            </div>
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu" data-widget="tree">
                <li class="header">系统菜单</li>
                <?php if(!empty($sidebar['menu'])): if(is_array($sidebar['menu']) || $sidebar['menu'] instanceof \think\Collection || $sidebar['menu'] instanceof \think\Paginator): $i = 0; $__LIST__ = $sidebar['menu'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$side): $mod = ($i % 2 );++$i;?>
                <li class="treeview<?php if($side['active']): ?> active menu-open<?php endif; ?>">
                    <a href="javascript:;">
                        <i class="<?php echo htmlentities($side['icon']); ?>"></i> <span><?php echo htmlentities($side['name']); ?></span>
                        <span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
                    </a>
                    <ul class="treeview-menu">
                        <?php if(is_array($side['children']) || $side['children'] instanceof \think\Collection || $side['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $side['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$children): $mod = ($i % 2 );++$i;?>
                        <li <?php if($children['active']): ?>class="active"<?php endif; ?>>
                        <a href="<?php echo htmlentities($children['url']); ?>"><i class="fa fa-circle-o"></i><?php echo htmlentities($children['name']); ?></a>
                        </li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; ?>
                <?php endif; ?>
                <li class="header">联系方式</li>
                <li><a href="http://www.a3-mall.com" target="_blank"><i class="fa fa-circle-o text-yellow"></i> <span>官方网站</span></a></li>
                <li><a href="http://wpa.qq.com/msgrd?v=3&uin=3439167048&site=qq&menu=yes"><i class="fa fa-circle-o text-red"></i> <span>QQ：3439167048</span></a></li>
                <li><a href="https://qm.qq.com/cgi-bin/qm/qr?k=lBxucAil6e6WTlwX0tNvQwpOtfLP2ptd&jump_from=webapi"><i class="fa fa-circle-o text-red"></i> <span>Q群：892150829</span></a></li>
                <li><a href="javascript:;"><i class="fa fa-circle-o text-aqua"></i> <span>手机：18026740326</span></a></li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <div class="content-wrapper clearfix">
        <div class="row content-nav inline-page-box">
    <div class="col-xs-12">
        <ul>
            <li><a href="javascript:;"><i></i>&nbsp;微信管理</a></li>
            <li><a href="javascript:;">公众号</a></li>
        </ul>
    </div>
</div>

<section class="content">
    <div class="row">
        <div class="col-md-3 l-col-md-3">

            <div class="box box-solid">
                <div class="box-header with-border">
                    <h3 class="box-title">菜单</h3>

                    <div class="box-tools">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <div class="box-body no-padding">
                    <ul class="nav nav-pills nav-stacked">
                        <ul class="nav nav-pills nav-stacked">
    <?php if(is_array($sidebar['menu']) || $sidebar['menu'] instanceof \think\Collection || $sidebar['menu'] instanceof \think\Paginator): $i = 0; $__LIST__ = $sidebar['menu'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sidebar): $mod = ($i % 2 );++$i;if(is_array($sidebar['children']) || $sidebar['children'] instanceof \think\Collection || $sidebar['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $sidebar['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$children): $mod = ($i % 2 );++$i;if($children['active']): if(is_array($children['children']) || $children['children'] instanceof \think\Collection || $children['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $children['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($i % 2 );++$i;?>
                <li<?php if($value['active']): ?> class="active"<?php endif; ?>><a href="<?php echo htmlentities($value['url']); ?>"><?php echo htmlentities($value['name']); ?></a></li>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            <?php endif; ?>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
                    </ul>
                </div>

            </div>

        </div>

        <div class="col-md-9 r-col-md-9">
            <div class="layui-fluid">
                <div class="layui-card">

                    <div class="col-md-4 l-col-md-4">
                        <div class="wechat-preview inline-block">
                            <div class="wechat-header">公众号</div>
                            <div class="wechat-body">
                                <iframe id="wechat-ifrmae-box" frameborder="0" marginheight="0" marginwidth="0" src=""></iframe>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-8 r-col-md-8">
                        <section class="content clearfix" style="padding-top: 0;">
                            <div class="layui-editor-box">
                                <div style="margin-top: 0;" class="layui-tab layui-tab-brief layui-tab-bg layui-tab-content-box">
                                    <ul class="layui-tab-title">
                                        <li class="layui-this">基本信息</li>
                                    </ul>
                                    <form action="" class="layui-form layui-form-pane">
                                        <div class="layui-tab-content">
                                            <div class="layui-tab-item layui-show">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">状态</label>
                                                    <div class="layui-input-block">
                                                        <input type="radio" name="status" title="开启" value="0" <?php if(empty($data['status']) || $data['status']==0): ?>checked="checked"<?php endif; ?>>
                                                        <input type="radio" name="status" title="关闭" value="1" <?php if(isset($data['status']) && $data['status']==1): ?>checked="checked"<?php endif; ?>>
                                                    </div>
                                                </div>

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">消息类型</label>
                                                    <div class="layui-input-block">
                                                        <input type="radio" name="type" title="文字" value="text" lay-filter="type" <?php if(empty($data['type']) || $data['type']=="text"): ?>checked="checked"<?php endif; ?>>
                                                        <input type="radio" name="type" title="图文" value="news" lay-filter="type" <?php if(empty($data['type']) || $data['type']=="news"): ?>checked="checked"<?php endif; ?>>
                                                        <input type="radio" name="type" title="图片" value="image" lay-filter="type" <?php if(empty($data['type']) || $data['type']=="image"): ?>checked="checked"<?php endif; ?>>
                                                        <!-- input type="radio" name="type" title="音乐" value="music" lay-filter="type">
                                                        <input type="radio" name="type" title="视频" value="video" lay-filter="type">
                                                        <input type="radio" name="type" title="语音" value="voice" lay-filter="type" -->
                                                    </div>
                                                </div>

                                                <div class="layui-form-item data-type" data-type="text">
                                                    <label class="layui-form-label">回复内容</label>
                                                    <div class="layui-input-block">
                                                        <textarea class="layui-textarea" name="content"><?php echo htmlentities((isset($data['content']) && ($data['content'] !== '')?$data['content']:'')); ?></textarea>
                                                    </div>
                                                </div>

                                                <div class="layui-form-item data-type" data-type="news">
                                                    <label class="layui-form-label">选择图文</label>
                                                    <div class="layui-input-block">
                                                        <button type="button" id="select-news-btn" class="layui-btn layui-btn-primary">选择图文</button>
                                                    </div>
                                                </div>

                                                <div class="layui-form-item data-type" data-type="image">
                                                    <label class="layui-form-label">图片地址</label>
                                                    <div class="layui-input-block">
                                                        <input type="text" id="image-input-text" name="image_url" value="<?php echo htmlentities((isset($data['image_url']) && ($data['image_url'] !== '')?$data['image_url']:'')); ?>" placeholder="请上传图片" readonly="readonly" style="width: 70%;float: left;" autocomplete="off" class="layui-input">
                                                        <button type="button" id="upload-images" class="layui-btn layui-btn-primary" style="float: left">上传图片</button>
                                                    </div>
                                                </div>

                                            </div>

                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-input-block">
                                                <input type="hidden" name="news_id" value="<?php echo htmlentities((isset($data['news_id']) && ($data['news_id'] !== '')?$data['news_id']:'0')); ?>">
                                                <input type="hidden" name="id" value="<?php echo htmlentities((isset($data['id']) && ($data['id'] !== '')?$data['id']:'0')); ?>">
                                                <button class="layui-btn layui-bg-light-blue" lay-filter="layui-submit-filter" lay-submit="">立即提交</button>
                                                <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </section>
                    </div>

                </div>
            </div>
        </div>

    </div>

</section>
<style type="text/css">
.data-type{ display: none; }
</style>
<script type="text/javascript">
    var setUrl = function (type){
        var url = "";
        var content = "";
        switch(type){
            case "text":
                url = '<?php echo createUrl("common.wechat/index",["type"=>"text"]); ?>';
                content = $('[name="content"]').val();
                break;
            case "news":
                url = '<?php echo createUrl("common.wechat/index",["type"=>"news"]); ?>';
                content = $('[name="news_id"]').val();
                break;
            case "image":
                url = '<?php echo createUrl("common.wechat/index",["type"=>"image"]); ?>';
                content = $('[name="image_url"]').val();
                break;
        }
        url += url.indexOf("?") != -1 ? "&content=" + content : "?content=" + content;
        $("#wechat-ifrmae-box").attr("src",url);
    };
    var handleNews = function (id){
        $('[name="news_id"]').val(id);
        setUrl("news");
    };
    $(function (){

        layui.use(["form", "element","layer","upload"], function () {
            var form = layui.form;
            var layer = layui.layer;
            var upload = layui.upload;

            <?php if(isset($data['type'])): ?>
            $('[data-type="<?php echo htmlentities($data['type']); ?>"]').show();
            setUrl("<?php echo htmlentities($data['type']); ?>");
            <?php else: ?>
            $('[name="type"]').prop("checked",false);
            $('[value="text"]').prop("checked",true);
            form.render();
            $('[data-type="text"]').show();
            setUrl("text");
            <?php endif; ?>

            $("#select-news-btn").on("click",function (){
                layer.open({
                    type: 2,
                    title: false,
                    closeBtn: 1,
                    shadeClose: true,
                    skin: 'yourclass',
                    area: ['80%', '90%'],
                    content: '<?php echo createUrl("common.wechat/article"); ?>'
                });

                return false;
            });

            form.on('radio(type)', function(data){
                $(".data-type").hide();
                $('[data-type="'+data.value+'"]').show();
                setUrl(data.value);
            });

            $('[name="content"]').on("input",function (){
                setUrl("text");
            })

            upload.render({
                elem: '#upload-images'
                ,url: '<?php echo url("common.uploadfiy/upload"); ?>'
                ,multiple: false
                ,exts: 'jpg|png|gif|bmp|jpeg'
                ,data: {
                    module: function (){
                        return "keys";
                    },
                    method: function (){
                        return "";
                    }
                }
                ,done: function(res){
                    if(!res.code){
                        $("#image-input-text").val(res.data.src);
                        setTimeout(function (){ setUrl("image"); },200);
                    }else{
                        layer.msg(res.msg,{ icon : 2 });
                    }
                }
            });

            form.on('submit(layui-submit-filter)', function (data) {
                var index = layer.load(1, { shade: [0.2,'#fff'] });
                $.post('<?php echo createUrl("defaults"); ?>', data.field, function (result) {
                    layer.close(index);
                    if(result.code){
                        layer.msg(result.msg, {
                            time: 3000
                        },function (){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(result.msg,{ icon :2 });
                    }
                }, "json");
                return false;
            });
        });

    });
</script>




    </div>

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> <?php echo htmlentities(config('version.version')); ?>
        </div>
        <strong>Copyright &copy; 2019-<?php echo date("Y"); ?> <a href="http://www.a3-mall.com">数循通云计算科技有限公司 | A3Mall</a>.</strong> All rights
        reserved.
    </footer>

</div>

</body>
</html>